home *** CD-ROM | disk | FTP | other *** search
/ Aminet 7 / Aminet 7 - August 1995.iso / Aminet / comm / mebbs / freqassist102.lha / FreqAssist.rexx < prev   
OS/2 REXX Batch file  |  1995-02-10  |  3KB  |  110 lines

  1. /***********************************
  2.  *                                 * 
  3.  *     FreqAssist Version 1.02     *
  4.  *    by Steve Robbins [M3014]     *
  5.  *           RFS Software          *
  6.  *      Last updated 10 Jan 95     *
  7.  *                                 *
  8.  ***********************************/
  9.  
  10. options results
  11. parse arg LineNumber
  12. if ~show('L','rexxsupport.library') then do                  
  13.    if addlib('rexxsupport.library',0,-30,0) then NOP
  14.    else do
  15.       say 'Rexxsupport.library is not available'
  16.       exit 10
  17.    end
  18. end
  19. signal on syntax
  20. signal on ioerr
  21. signal on BREAK_C
  22.  
  23. x = 0
  24. i = 0
  25. j = 0
  26. k = 0
  27. say " "
  28. say " FreqAssist     Version 1.02     by: Steve Robbins [M3014]     RFS Software"
  29. say " "
  30. call open(config,"MEBBSNet:ConfigFiles/FreqAssist.cfg",'R')
  31. do until EOF(config)
  32.    junk = readln(config)
  33.    if left(junk, 5) == "MAGIC" then do
  34.       i = i + 1
  35.       ConfigMagic.i = junk
  36.    end
  37.    if left(junk, 8) == "PASSWORD" then do
  38.       j = j + 1
  39.       ConfigPass.j = junk
  40.    end
  41.    if left(junk, 7) == "PASSDIR" then do
  42.       k = k + 1
  43.       ConfigPassDir.k = junk
  44.    end
  45. end
  46. call close(config)
  47. call pragma('directory',"MEBBSNet:ConfigFiles")
  48. address command "rename freq.cfg freq.bak"
  49. call open(freq,"MEBBSNet:ConfigFiles/freq.bak",'R')
  50. call open(freq1,"MEBBSNet:ConfigFiles/freq.cfg",'W')
  51. do until EOF(freq)
  52.    junk = readln(freq)
  53.    freqname = word(junk,1)
  54.    path = Word(junk,2)
  55.    password = word(junk,3)
  56.    do l = 1 to j     
  57.       if Upper(path) == Upper(word(ConfigPass.l,2)) then do
  58.          if length(word(configpass.l,3)) > 8 then do
  59.             x = 1
  60.             say "Failed adding a password to "freqname", password exceeds 8 characters."
  61.          end
  62.          if x ~= 1 then password = word(ConfigPass.l,3)
  63.          if x ~= 1 then say "Adding password to "freqname
  64.       end
  65.       x = 0
  66.    end
  67.    do m = 1 to i
  68.       if Upper(path) == Upper(word(ConfigMagic.m,3)) then do
  69.          freqname1 = word(ConfigMagic.m,2)
  70.          say "Adding Magic Name - "freqname1
  71.          junk = Upper(freqname1)" "path" "password
  72.          call writeln(freq1, junk)
  73.       end
  74.    end
  75.    do n = 1 to k
  76.       if Upper(left(path,lastpos("/", path))) == Upper(word(ConfigPassDir.n,2)) | Upper(left(path,lastpos(":", path))) == Upper(word(ConfigPassDir.n,3)) then do
  77.          if length(word(configpassdir.l,3)) > 8 then do
  78.             x = 1
  79.             say "Failed adding a password to "freqname", password exceeds 8 characters."
  80.          end
  81.          if x ~= 1 then password = word(ConfigPassDir.n,3)
  82.          if x ~= 1 then say "Adding password to "freqname
  83.       end
  84.       x = 0
  85.    end
  86.    junk = Upper(freqname)" "path" "password
  87.    call writeln(freq1, junk)
  88. end
  89. call close(freq)
  90. call close(freq1)
  91. address command "delete MEBBSNet:ConfigFiles/freq.bak QUIET"
  92. say " "
  93. exit
  94.       
  95.  
  96. BREAK_C:
  97. exit
  98.  
  99. syntax:
  100.    say "**syntax** in FreqAssist in line: " SIGL " Severity: " RC
  101.    exit
  102.  
  103. ioerr:
  104.    say "**IO ERROR** in FreqAssist in line: " SIGL " Severity: " RC
  105.    exit
  106.  
  107.  
  108.  
  109.  
  110.